package com.wqr.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wqr.dao.DeliciousUserDao;
import com.wqr.pojo.DeliciousUser;
@Service
public class DeliciousUserServiceImp implements DeliciousUserService {

	@Autowired
	public DeliciousUserDao deliciousUserDao;
	
	public List<DeliciousUser> list(DeliciousUser deliciousUser) throws Exception {
		//DeliciousUserExample example = new DeliciousUserExample();
		List<DeliciousUser> list = deliciousUserDao.selectByWhere(deliciousUser);
		return list;
	}

	public int delectDeliciousUser(Integer userStateId) throws Exception {
		int a = deliciousUserDao.deleteByPrimaryKey(userStateId);
		if(a > 0) {
			return 1;
		}else {
			return 0;
		}
	}
	public int insertDeliciousUser(DeliciousUser deliciousUser) throws Exception {
		int a = deliciousUserDao.insertSelective(deliciousUser);
		if(a > 0) {
			return 1;
		}else {
			return 0;
		}
	}
	public int updateDeliciousUser(DeliciousUser deliciousUser) throws Exception {
		int a = deliciousUserDao.updateByPrimaryKeySelective(deliciousUser);
		if(a > 0) {
			return 1;
		}else {
			return 0;
		}
	}

	public List<DeliciousUser> selectDeliciousUser(DeliciousUser deliciousUser) throws Exception {
		List<DeliciousUser> list = deliciousUserDao.selectByWhere(deliciousUser);
		return list;
	}

	public List<DeliciousUser> selectByPrimaryKey(Integer deliciousUserId) throws Exception {
		List<DeliciousUser> list = deliciousUserDao.selectByPrimaryKey(deliciousUserId);
		return list;
	}

}
